<div class="art-layout-cell art-sidebar1">
<div class="art-block">
    <div class="art-block-cc"></div>
    <div class="art-block-body">
        <div class="art-blockheader">
            <div class="l"></div>
            <div class="r"></div>
            <div class="t"><!-- Block header -->
                Thông tin bài thi
            </div>
        </div>
        <div class="art-blockcontent">
            <div class="art-blockcontent-tl"></div>
            <div class="art-blockcontent-tr"></div>
            <div class="art-blockcontent-bl"></div>
            <div class="art-blockcontent-br"></div>
            <div class="art-blockcontent-tc"></div>
            <div class="art-blockcontent-bc"></div>
            <div class="art-blockcontent-cl"></div>
            <div class="art-blockcontent-cr"></div>
            <div class="art-blockcontent-cc"></div>
            <div class="art-blockcontent-body">

                <!-- block-content -->

<div>
    Tên sinh viên: <strong><?php echo $examInfo->studentname; ?></strong><br />
    Số hiệu: <strong><?php echo $examInfo->studentid; ?></strong><br />
    Môn thi: <br /><strong><?php echo $examInfo->subject; ?></strong><br />
    Lớp: <strong><?php echo $classID; ?></strong> <br />
    Học kì: <strong><?php echo $examInfo->semester; ?></strong> <br /><br />
    Đã làm: <strong><?php echo "$count / $totalCount"; ?></strong> <br /><br />

    <fieldset>
        <legend>Thời gian</legend>
        Hiện tại: <span id='now' style="color: blue;"></span> <br />
        Còn lại: &nbsp;<span id='remain' style="color: red;"></span>
    </fieldset>
</div>

<form name='autoendtest' id='autoendtest' action='<?php echo Utility::getSiteUrl(); ?>/testing/endtest' method='post'>
        <input type='hidden' name='classid' id='classid' value='<?php echo $classID; ?>'>
        <input type='submit' name='hiddensubmit' id='hiddensubmit' class='art-button' value='Nộp bài thi!' style='display: none;' onclick="alert('Hết giờ! Đã lưu kết quả.');">
</form>

<script type="text/javascript">
    var h= <?php echo $now->format('H'); ?>;
    var m= <?php echo $now->format('i'); ?>;
    var s= <?php echo $now->format('s'); ?>;

    var rh= <?php echo $remain->format('%h'); ?>;
    var rm= <?php echo $remain->format('%i'); ?>;
    var rs= <?php echo $remain->format('%s') - 5; ?>;

    function showTime()
    {
        th = (h>=10)?h:"0"+h;
        tm = (m>=10)?m:"0"+m;
        ts = (s>=10)?s:"0"+s;
        trh = (rh>=10)?rh:"0"+rh;
        trm = (rm>=10)?rm:"0"+rm;
        trs = (rs>=10)?rs:"0"+rs;
        document.getElementById('now').innerHTML= " "+th+" giờ "+tm+" phút "+ts+" giây";
        document.getElementById('remain').innerHTML= " "+trh+" giờ "+trm+" phút "+trs+" giây";
        s++;
        if (s==59){
            m++;
            s=0;
        }
        if (m==59){
            h++;
            m=0;
        }
        if (h==23) h=0;

        rs--;
        if (rs==-1){
            rm--;
            rs=59;
        }
        if (rm==-1){
            rh--;
            rm=59;
        }
        if (rh==0 && rm==0 && rs==0){
            //alert('Hết giờ! Đã lưu kết quả');
            document.getElementById('hiddensubmit').click();
        }
    }

    showTime();
    setInterval('showTime()',1000);
</script>
                <!-- /block-content -->

                <div class="cleared"></div>
            </div>
        </div>
        <div class="cleared"></div>
    </div>
</div>
</div>
